﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Sky.Common;
using EtlComm;

namespace EtlLog
{
    class FileLog : ClientBaseLog
    {
        public override bool WriteLog(string loginfo)
        {
            base.WriteLog(loginfo);
            try
            {
                FileStream fs = new FileStream("log.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite, 1024);
                fs.Write(Encoding.Default.GetBytes(loginfo), 0, 1024);
                fs.Close();
                return true;
            }
            catch (System.Exception ex)
            {
                base.WriteLog(ex.Message);
                return false;
            }
        }
        public override bool WriteLog(string StationID, string TaskID, string loginfo)
        {
          
            try
            {
                Logger.WriteLog(StationID, loginfo);
                return true;
            }
            catch (System.Exception ex)
            {
                base.WriteLog(ex.Message);
                return false;
            }
        }
    }
}
